/**
 * Created by Allen on 2018/3/16.
 */
import config from 'config'
import httpFetch from 'share/httpFetch'

export default {
  //绑定服务
  handleBind(supplierName,params){
    return httpFetch.post(`${config.baseUrl}/api/${supplierName}/company/config/bigcus/bind`,params)
  },

  //开通携程服务
  handleOpen(supplierName,companyOID){
    return httpFetch.post(`${config.baseUrl}/api/${supplierName}/company/register?companyOID=${companyOID}&isApproval=0`)
  },

  //调artemis接口获取token
  getToken(companyOID,params){
    return httpFetch.post(`${config.baseUrl}/api/v2/didi/company/openauth/token?companyOID=${companyOID}`,params)
  },

  //判断商务卡开通状态
  checkCMBCStatus(){
    return httpFetch.post(`${config.baseUrl}/api/tenant/bankcard/status/open/CMBC`)
  },

  //开通商务卡
  openCMBC(params){
    return httpFetch.post(`${config.baseUrl}/api/tenant/bankcard/account/CMBC`,params)
  },

  //获取商务卡开通用户的列表
  getCMBCAccount(){
    return httpFetch.get(`${config.baseUrl}/api/tenant/bankcard/accounts/CMBC`)
  },

  //开通饿了么
  openEleme(params){
    return httpFetch.post(`${config.baseUrl}/api/register/add/service/by/keyorcode`,params)
  },

  //开通HRS
  openHRS(params){
    return httpFetch.post(`${config.baseUrl}/api/hrs/company/bind`,params);
  },

  //开通京东
  openJD(params){
    return httpFetch.post(`${config.baseUrl}/api/jd/company/config/bind`,params);
  },

  //开通甄选酒店
  enableHeliosHotel(params){
    return httpFetch.post(`${config.baseUrl}/api/zhenxuan/company/bind`,params);
  },

  //滴滴是否授权
  didiIsEnable(companyId){
    return httpFetch.get(`${config.baseUrl}/api/v2/didi/company?companyOID=${companyId}`);
  }
}
